package com.wolfheader.wolfgame.entity.admin;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;

import com.wolfheader.wolfgame.entity.BaseEntity;

@Entity
@Table(name = "t_product_level")
public class ProductLevelEntity extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4699959916471535231L;

	/**
	 * 级别拿货价
	 */
	private BigDecimal price;

	/**
	 * 级别越小越顶级
	 */
	private Integer level;

	/**
	 * 累计升级
	 */
	private Boolean grandUp;

	/**
	 * 描述
	 */
	private String remark;

	/**
	 * 盒Num
	 */
	private Integer heNum;

	/**
	 * 补货价格
	 */
	private BigDecimal consumePrice;

	/**
	 * 属于产品
	 */
	private ProductEntity product;

	@Min(0)
	@Digits(integer = 19, fraction = 2)
	@Column(nullable = false)
	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Column(nullable = false)
	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Boolean getGrandUp() {
		return grandUp;
	}

	public void setGrandUp(Boolean grandUp) {
		this.grandUp = grandUp;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(nullable = false)
	public Integer getHeNum() {
		return heNum;
	}

	public void setHeNum(Integer heNum) {
		this.heNum = heNum;
	}

	@Min(0)
	@Digits(integer = 19, fraction = 2)
	@Column(nullable = false)
	public BigDecimal getConsumePrice() {
		return consumePrice;
	}

	public void setConsumePrice(BigDecimal consumePrice) {
		this.consumePrice = consumePrice;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(nullable = false, updatable = false)
	public ProductEntity getProduct() {
		return product;
	}

	public void setProduct(ProductEntity product) {
		this.product = product;
	}

}
